package controller.cartp;

import com.zuche.framework.remote.RemoteClientFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by PCG on 2016/7/30.
 */
@Controller
public class RemoteServerController {

    @RequestMapping("/remotePage.do_")
    @ResponseBody
    public Object getPageBindCard(HttpServletRequest request){
        String url = "cartp.creditcardbind.report";
        Map<String,Object> params = new HashMap<String,Object>();
        params.put("sourceId","CMB");
        params.put("isCompany","1");
        params.put("companyId","");
        params.put("defaultOrder","modifyTime desc");
        params.put("startIndex",1);
        params.put("endIndex",10);
        return RemoteClientFactory.getInstance().executeToObject(url,params);
    }

    @RequestMapping("/remoteReport.do_")
    @ResponseBody
    public Object getReportBindCard(HttpServletRequest request){
        String url = "cartp.creditcardbind.report";
        Map<String,Object> params = new HashMap<String,Object>();
//        params.put("sourceId","CMB");
//        params.put("payerId","5125270");
        params.put("payerId","41817949");
//        params.put("isCompany","1");
//        params.put("companyId","292");
//        params.put("cardNoDec","6225768765153968");
        params.put("defaultOrder","modifyTime desc");
        params.put("startIndex",0);
        params.put("endIndex",10);
        return RemoteClientFactory.getInstance().executeToObject(url,params);
    }

    @RequestMapping("/remoteQuery.do_")
    @ResponseBody
    public Object getQueryCard(HttpServletRequest request){
        String url = "cartp.creditcardbind.query";
        Map<String,Object> params = new HashMap<String,Object>();
//        params.put("cardNo","6225880150931245");
//        params.put("companyId","1771");
//        params.put("isAutoPay",2);
//        params.put("cardType",1);
        params.put("payerId","13447071");
//        params.put("payerId","5125270");
//        params.put("status",1);
//        params.put("bindId","33695");
        return RemoteClientFactory.getInstance().executeToObject(url,params);
    }


    @RequestMapping("/remoteQueryId.do_")
    @ResponseBody
    public Object getQueryId(HttpServletRequest request){
        String url = "cartp.creditcardbind.queryId";
//        return RemoteClientFactory.getInstance().executeToObject(url,"5125270");
        return RemoteClientFactory.getInstance().executeToObject(url,"13447071");
    }



    @RequestMapping("/remoteCdmsQuery.do_")
    @ResponseBody
    public Object getCdmsQuery(HttpServletRequest request){
        String url = "cartp.record.cdmsquery";
        return RemoteClientFactory.getInstance().executeToObject(url,"01327315102303345");
    }
}
